import time
# 订单编号生成函数
def generate_order_id():
    now_time = time.strftime(r'%Y%m%d%H%M%S', time.localtime(time.time()))
    t = str(time.time()).split(".")[-1]
    time.sleep(0.011137)
    order_id = (str(now_time) + t)[:20]
    if len(order_id) != 20:
        print("-----------------------------")
        return generate_order_id()
    return order_id